package com.sunye.mongodb;




import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.index.GeoSpatialIndexType;
import org.springframework.data.mongodb.core.index.GeoSpatialIndexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.List;

/**
 * 商品索引
 *
 * @author paulG
 **/
@Data
@Document(value="MongoDogIndex")
public class MongoDogIndex implements Serializable {

    private static final long serialVersionUID = -6856471777036048874L;

    @Id
    private String id;

    /**
     * 名称
     */
    @Field("dog_name")
    private String dogName;

    /**
     * 简介
     */
    private String introduct;



    private Integer categoryFirstId;



    private Integer categorySecondId;


    private String color;



    private String saleStatus;



    private Integer age;


    private Boolean recommend;

    private String img;


    private Double price;


    private Integer salesNumber;



    private String dogBreed;


    @GeoSpatialIndexed
    private Double[] location;//地理位置
//    private Location location;

    /**
     * 卖点
     */
    private List<MongoDogSellingPointIndex> sellingPointList;


    private List<Sku> skuList;

    private String deleted;

    @Data
    public static class Sku{
        private String id;
        private String  title;
    }

    @Data
    public static class Location{
        private double lat;
        private double lon;
    }





}
